<template>
  <div class="excel-text">
  <div>{{key}} </div>
  <el-input v-model="val"></el-input>
  </div>
</template>

<script>
import {toLetters} from "@/zpkgs/components/z-data-grid/utils";

function truncate(text = '', stop, clamp) {
  return text.slice(0, stop) + (stop < text.length ? clamp || '...' : '')
}

export default {
  name: 'ExcelText',
  props: {
    text: null,
    row: null,
    column: null
  },
  inject: ['ExcelFormIns'],
  computed: {
    computedText() {
      return truncate(this.text, 6, '...')
    },
    key() {
      return `${this.row}_${this.column}`
    },
    excel_key() {
      return toLetters(this.column + 1) + (this.row + 1)
    }
  },
  created() {
    // console.log(this.ExcelFormIns)
  },
  data() {
    return {
      val: ''
    }
  }
}
</script>
